package it.univaq.mwt.model.entity;

import java.io.Serializable;
import java.util.Set;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;

@Entity
@NamedQueries({ 
	@NamedQuery(name="getListCategory",query="SELECT c FROM Category c")
})
@SequenceGenerator(name="sequence",sequenceName="MASTER.CATEGORY_SEQ")
public class Category implements Serializable {

	@Id
	@GeneratedValue(generator="sequence")   
	@Column(name="id_category",nullable=false,length=11)
	private int id;
	
	@Column(name="category_name",nullable=false,length=200)
	private String name;
	
	@OneToMany(mappedBy="category")
	private Set<Gift> gift;	
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<Gift> getGift() {
		return gift;
	}

	public void setGift(Set<Gift> gift) {
		this.gift = gift;
	}
	
	
	
}
